package cn.hnevc.xiaohui;

public class StudentP {
	String name;
	public StudentP(String name) {
		System.out.println(name);
	}
	//定义学生说的方法
	void speak() {
		System.out.println("我叫" + name);
		
	}

}
//子类自动拥有父类的属性和行为
class StudentC extends StudentP{
	public StudentC() {
		super("小小");
	}
	//public void printName() {
	void speak() {
	
	System.out.println("我叫" + name);
	}

	public void printName() {
		System.out.println("我叫" + name);
	}
	// void printName() {
		// TODO Auto-generated method stub
		
	}

	
	
